package com.house.user.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.house.user.dao.RightDao;
import com.house.user.dao.UserDao;
import com.house.user.entity.Right;
import com.house.user.entity.User;
import com.house.user.service.IRightService;
import com.house.user.service.IUserService;

@Service
@Transactional
public class RightServiceImpl implements IRightService{

	@Autowired
	private RightDao rightDao;

	@Override
	public void saveOrUpdate(Right right) {
		// TODO Auto-generated method stub
		rightDao.save(right);
	}

	@Override
	public void delete(Right right) {
		// TODO Auto-generated method stub
		rightDao.delete(right);
	}

	@Override
	public Right findOne(Integer id) {
		// TODO Auto-generated method stub
		Right right = rightDao.findOne(id.longValue());
		return right;
	}

	@Override
	public List<Right> findAll() {
		// TODO Auto-generated method stub
		 List<Right> list = (List<Right>) rightDao.findAll();
		return list;
	}



}
